Figure 4: Multigrid on an Unstructured Mesh: Routines for Restriction and Prolongation Figure 2: Multigrid on an Unstructured Mesh: Main Program and Cycle Routine 22
نویسندگان
چکیده
! zero coarse grid right forcing function vlist(:)%f = 0.0 ! loop over fine grid vertices !HPF$ INDEPENDENT , ON (HOME(fine vlist(v)), NEW (va,vb,vc), REDUCTION (vlist(:) %res) !HPF+ GATHER (fine vlist::s(lv)), GATHER (vlist::g(lv)), SCATTER (vlist::g(lv)) DO v = 1, fine nvert va = fine vlist(v)%par a; vb = fine vlist(v)%par b; vc = fine vlist(v)%par c ! accumulate residual at a fine grid vertex unto its coarse grid parent vertices vlist(va)%res = vlist(va)%res + fine vlist(v)%ca * fine vlist(v)%res vlist(vb)%res = vlist(vb)%res + fine vlist(v)%cb * fine vlist(v)%res vlist(vc)%res = vlist(vc)%res + fine vlist(v)%cc * fine vlist(v)%res END DO END SUBROUTINE prolo(fine vlist, fine nvert, vlist, nvert, lv, nlev) TYPE (vert) :: vlist(nvert), fine vlist(fine nvert) ! loop over fine grid vertices !HPF$ INDEPENDENT , ON (HOME(fine vlist(v)), NEW (va,vb,vc), REDUCTION (fine vlist(:)%sol) !HPF+ GATHER (vlist::s(lv)), GATHER (fine vlist::g(lv)), SCATTER (fine vlist::g(lv)) DO v = 1, fine nvert va = fine vlist(v)%par a; vb = fine vlist(v)%par b; vc = fine vlist(v)%par c ! linearly interpolate values in vertices va,vb,vc and update v fine vlist(v)%sol = fine vlist(v)%sol + fine vlist(v)%ca * vlist(va)%delta + & fine vlist(v)%cb * vlist(vb)%delta + fine vlist(v)%cc * vlist(vc)%delta + & ! initialize residual to forcing function vlist(:)%res = vlist(:)%f ! loop over edges on this level accumulating residual unto vertices DO e = 1, nedge ia = elist(e)%va ib = elist(e)%vb flx = flux(vlist(ia), vlist(ib)) vlist(ia)%res = vlist(ia)%res + flx vlist(ib)%res = vlist(ib)%res-flx END DO ! loop over vertices on this level " relaxing " solution vlist(:)%sol = vlist(:)%sol + om * vlist(:)%res ! update boundaries CALL apply bc(vlist, nvert) END Figure 3: Multigrid on an Unstructured Mesh: Relaxation Routine 23 PROGRAM main INTEGER nlev TYPE (grid type), ALLOCATABLE :: grids(:) REAL err ! allocates grids(0:nlev-1) and the edge list, elist, and the vertex list, vlist, ! at each level based on input values and sets up parent-child and neighbor interconnections CALL setup(grids, nlev) ! set fine grid forcing function CALL fine set(grids(0)%vlist) DO WHILE (err. GE. 1.0E-5) CALL cycle(grids, nlev) err = sqnorm(grids(0)%vlist) END DO ... END SUBROUTINE cycle(grids, nlev) TYPE (grid type) :: grids(:) INTEGER nlev INTEGER lv, lvc ! relax each level, and perform restriction, moving to coarsest grid DO lv = 0, nlev-1 lvc = lv +1 CALL relax(grids(lv)%vlist, grids(lv)%nvert, grids(lv)%elist, grids(lv)%nedge, lv, nlev) CALL rest(grids(lv)%vlist, grids(lv)%nvert, grids(lvc)%vlist, grids(lvc)%nvert, lv, nlev) END DO ! relax each level, and perform prolongations, …
منابع مشابه
Iterations for the Airfoil Mesh. Multiplicative Schwarz
Overlap Level of Regular Dual graph (no. elements) coarse grid coarsening coarsening 0 None 56 56 0 4 21 22 0 3 15 12 1 None 16 16 1 4 10 10 1 3 7 7 2 None 14 14 2 4 8 8 2 3 5 5 Table 2 Multigrid iterations for the Airfoil mesh Regular coarsening Dual graph coarsening MG Levels Nodes Dir. B. Overlapping schwarz methods on unstructured meshes using non-matching coarse grids. Domain decomposition...
متن کاملMultigrid Acceleration of an Upwind Euler Solver on Unstructured Meshes
Multigrid acceleration has been implemented for an upwind ow solver on unstructured meshes. The ow solver is a straightforward implementation of Barth and Jespersen's unstructured scheme, with least-squares linear reconstruction and a directional implementation of Venkatakr-ishnan's limiter. The multigrid scheme itself is designed to work on mesh systems which are not nested, allowing great exi...
متن کاملOn Mesh-to-Mesh Transfer Operators for Unstructured Multigrid Solvers
A new mesh-to-mesh data transfer operator for unstructured multigrid methods is presented. The new algorithm integrates piecewise continuous (reconstructed) data deened on a source mesh over the control volumes of a target mesh. Analysis in one dimensions and numerical experiments in two dimensions demonstrate that this approach signiicantly reduces data transfer errors when compared to interpo...
متن کاملp-Multigrid Method for Fekete-Gauss Spectral Element Approximations of Elliptic Problems
An efficient p-multigrid method is developed to solve the algebraic systems which result from the approximation of elliptic problems with the so-called FeketeGauss Spectral Element Method, which makes use of the Fekete points of the triangle as interpolation points and of the Gauss points as quadrature points. A multigrid strategy is defined by comparison of different prolongation/restriction o...
متن کاملA Multigrid Method for Steady Euler Equations on Unstructured Adaptive Grids
SUMMARY A ux-diierence splitting type algorithm is formulated for the steady Euler equations on un-structured grids. The polynomial ux-diierence splitting technique is used. A vertex-centered nite volume method is employed on a triangular mesh. The multigrid method is in defect-correction form. A relaxation procedure with a rst order accurate inner iteration and a second-order correction perfor...
متن کامل